<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition template="/pages/protected/user/default.xhtml">
		<ui:define name="content">
			<h3>#{msgs.updateUserHeader}</h3>
			<h:form id="userupdate">
				<h:inputHidden value="#{accountingSessionBean.user.id}" />
				<h:panelGrid columns="2" styleClass="panelGrid"
					rowClasses="panelFirstLine,panelNextLine">
					<h:outputLabel for="username" value="#{msgs.loginUserName}" />
					<h:outputLabel id="username"
						value="#{accountingSessionBean.user.username} " />

					<h:outputLabel for="name" value="#{msgs.Name}" />
					<h:outputLabel id="name"
						value="#{accountingSessionBean.user.name} " />

					<h:outputLabel for="new_password" value="#{msgs.loginPassword}" />
					<h:inputSecret id="new_password" />
					
					<h:outputLabel for="new_password_confirm" value="#{msgs.loginPasswordConfirm}" />
					<h:inputSecret id="new_password_confirm" />

					<h:outputLabel for="role" value="#{msgs.Role}" />
					<h:outputLabel id="role"
						value="#{accountingSessionBean.user.role} " />

					<h:outputLabel for="visible" value="#{msgs.publicData}" />
					<h:selectOneRadio id="visible"
						value="#{accountingSessionBean.user.visible}">
						<f:selectItem id="Y" itemLabel="#{msgs.yes}" itemValue="Y" />
						<f:selectItem id="N" itemLabel="#{msgs.no}" itemValue="N" />
					</h:selectOneRadio>
					
					<h:outputLabel for="delete" value="#{msgs.deleteMe}" />
					<h:commandButton id="delete" action="#{userMB.deleteCurrentUser()}"
							value="#{msgs.delete}"
							onclick="if (!confirm('#{msgs.areYouSure}')) return false">
					</h:commandButton>
				</h:panelGrid>
				<h:panelGrid columns="2">
					<h:link outcome="home" value="#{msgs.cancel}"
						immediate="true" />
					<h:commandButton action="#{userMB.updateUser()}"
						value="#{msgs.update}" />
				</h:panelGrid>
				<br />
			</h:form>
		</ui:define>
	</ui:composition>
</body>
</html>